
If ProcessExists("Rogue Tools.exe") Then
	$f = 0
Else
	MsgBox(4096, "Rogue Tools?", "You need to be running Rogue Tools in order to use this control")
	Exit
EndIf
$file = FileOpen(".\XChocvars.txt", 0)
$speed = FileReadLine($file, 1)
$rom = FileReadLine($file, 2)
FileClose($file)

Dim $paused
Dim $event
Dim $x
$XChoc = GUICreate("XChoc", 174, 35, 0, -1, -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Terminate")
HotKeySet("{F9}", "TogglePause")
$pausedinput = GUICtrlCreateButton("PAUSE", 24, 5, 60)
GUICtrlSetOnEvent(-1, "Pause")
$exit = GUICtrlCreateButton("Exit", 94, 5, 60)
GUICtrlSetOnEvent(-1, "Terminate")
GUISetState()
If $speed = 1 Then
	$sleep1 = 16000
EndIf
If $speed = 2 Then
	$sleep1 = 11000
EndIf
If $speed = 3 Then
	$sleep1 = 5000
EndIf
If $rom = 1 Then
	$rom1 = 2000
	$rom2 = 1000
EndIf
If $rom = 2 Then
	$rom1 = 4000
	$rom2 = 2000
EndIf
If $rom = 3 Then
	$rom1 = 8000
	$rom2 = 4000
EndIf
TogglePause()
While 1
	Sleep(10)
	While $paused = 0
		; ------ forms random #
		$x = Int(1 + Random(0, 6))
		$xx = $x * 1000
		$xxx = $rom1 + $xx
		; ------
		Sleep(5000)
		Send("{ESCAPE 4}")
		Sleep(200)
		Send("{HOME}")
		Sleep(200)
		; ------
		Send("{NUMPAD8 DOWN}")
		Sleep($xxx)
		Send("{NUMPAD8 UP}")
		Sleep(200)
		Send("{NUMPAD4 DOWN}")
		Sleep(100)
		Send("{NUMPAD4 UP}")
		Sleep(200)
		Send("{HOME}")
		Sleep(200)
		Send("{NUMPAD8 DOWN}")
		Sleep($xxx)
		Send("{NUMPAD8 UP}")
		Sleep(200)
		Send("{NUMPAD6 DOWN}")
		Sleep(100)
		Send("{NUMPAD6 UP}")
		Sleep(200)
		Send("{HOME}")
		Sleep(200)
		Send("{NUMPAD8 DOWN}")
		Sleep($xxx)
		Send("{NUMPAD8 UP}")
		Sleep(200)
		Send("{NUMPAD2 DOWN}")
		Sleep(100)
		Send("{NUMPAD2 UP}")
		Sleep(200)
		Send("{HOME}")
		Sleep(200)
		Send("{NUMPAD8 DOWN}")
		Sleep($xxx)
		Send("{NUMPAD8 UP}")
		Sleep(200)
		; ------ First dig
		Send("{ALTDOWN}")
		Sleep(200)
		Send("1")
		Sleep(200)
		Send("{ALTUP}")
		Sleep($sleep1)
		Sleep(200)
		Send("{NUMPAD8 DOWN}")
		Sleep(300)
		Send("{NUMPAD8 UP}")
		Sleep(200)
		; ------ Second dig
		Send("{ALTDOWN}")
		Sleep(200)
		Send("1")
		Sleep(200)
		Send("{ALTUP}")
		Sleep($sleep1)
		Sleep(200)
		Send("{NUMPAD8 DOWN}")
		Sleep(300)
		Send("{NUMPAD8 UP}")
		Sleep(200)
		; ------ Third dig
		Send("{ALTDOWN}")
		Sleep(200)
		Send("1")
		Sleep(200)
		Send("{ALTUP}")
		Sleep($sleep1)
	WEnd
WEnd
Func Pause()
	Send("{F9}")
EndFunc ;==>Pause
Func TogglePause()
	$paused = Not $paused
	If $paused = 0 Then
		GUICtrlSetData($pausedinput, 'RUNNING')
		Send("!{TAB}")
	ElseIf $paused = 1 Then
		Sleep(100)
		ToolTip("", 5, 5)
		GUICtrlSetData($pausedinput, 'PAUSED')
		Send("!{TAB}")
	EndIf
EndFunc ;==>TogglePause
Func Terminate()
	Exit
EndFunc ;==>Terminate

